<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <ul>
            <li v-for="(item, key,index) in obj" :key="index">
                <!-- 使用in 遍历时一般会用来遍历对象,参数有三个,分别为键值,键和下标 -->
                {{item}}----{{key}}----{{index}}
            </li>
            <!-- 使用of遍历有两个参数,item和index,一般使用of遍历数组 -->
            <li v-for="(item, index) of arr" :key="index">
                {{item}}----{{index}}
            </li>
        </ul>
    </div>
    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el: "#app",
            data() {
                return {
                    obj: {
                        key: "value",
                        key2: "value2",
                        key3: "value3"
                    },
                    arr: [12, 5, 4, 64, 5, 7]
                };
            },
        });
    </script>
</body>

</html>